<!doctype html>
<html class="no-js">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="description" content="">
    <meta name="keywords" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>我的利润</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-title" content="Amaze UI" />
    <meta name="msapplication-TileColor" content="#0e90d2">
    <link rel="stylesheet" href="assets/css/amazeui.min.css">
    <link rel="stylesheet" href="assets/css/app.css">
    <link rel="stylesheet" type="text/css" href="css/pageCode.css">
    <style>
        .onclic {
            background: #E0690C;
            color: #fff;
            display: inline-block;
            width: 35px;
            height: 35px;
            text-align: center;
            line-height: 33px;
            font-size: 16px;
            cursor: pointer;
        }

        input::-webkit-outer-spin-button,
        input::-webkit-inner-spin-button {
            -webkit-appearance: none;
        }

        input[type="number"] {
            -moz-appearance: textfield;
        }

        /**橙色字体
		 * */

        .text-ora {
            color: #0567CD;
        }

        /**橙色背景
		 * */

        .bg-ora {
            background: #0567CD;
            color: #fff;
        }

        /**淡蓝字体
		 * */

        .text-sky {
            color: #00aaee;
        }

        .active {
            color: #DD0101;
        }

        ul>li {
            height: 25%;
        }
    </style>
</head>

<body style="background: #f8f8f8;">
    <!-- 页面内容 开发时删除 -->
    <div id="" class="am-container">

        <div class="am-u">
            <div class="am-u-sm-12 gradien-bg am-text-center h50">
                <div style="color: #fff;">
                    <a href="home.html" style="margin-left:10px;" class="am-fl">
                        <img src="img/back.png" width="50%" />
                    </a>
                    我的利润
                    <div class="am-fr" style="margin-right:10px;">
                        <a href="ofsubsidiary.html">
                            <span style="color: #fff;">提现明细</span>
                        </a>
                    </div>
                </div>
            </div>
        </div>
        <div class="am-u">
            <div class="am-u-sm-12">
                <div class="bg-white am-text-center" style="padding: 10px 0;">
                    <div style="width: 60%;display: inline-block;position: relative;">
                        <img src="img/service_bg_profits@2x.png" class="" width="100%" />
                        <div style="position: absolute;bottom:0;top:10%;left:25%;width: 50%;color:#666;">
                            <ul style="height:80%;">
                                <li class="text-ora" id="todaymoney">0000</li>
                                <li>今日新增利润</li>
                                <li class="text-sky" id="cash">000000</li>
                                <li>可提现利润</li>
                            </ul>
                            <div style="position: absolute;bottom: 0;text-align: center;left: 0;right: 0;">
                                单位：元
                            </div>
                        </div>
                    </div>

                </div>
            </div>
            <div class="am-u-sm-12 am-text-center bg-white" style="padding: 10px 0;">
                <button type="button" onclick="javascrtpt:window.location.href='translation.html'" style="width:60%;border: 0;height:30px;line-height: 30px;border-radius: 10px;;"
                    class="bg-ora">利润提现</button>
                <p>账户累计利润
                    <span class="text-sky" id="total">￥：0.0000</span>
                </p>
            </div>
            <div class="am-u-sm-12">
                <p style="margin:0;line-height:40px;padding-left:10px;">利润明细</p>
            </div>
            <div class="am-u" id="lr_list">
                <!--	   	<div class="am-u-sm-12 bg-white" style="font-size:14px;margin-bottom:5px;">
                    <div class="am-u-sm-7">后台播发</div>
                    <div class="am-u-sm-5" style="text-align: right;">12.00</div>
                    <div class="am-u-sm-12" style="padding:0 1rem;">2140-01-01 12:45</div>
		</div>-->
            </div>
            <div class="tcdPageCode" style="color: red;text-align: center;"></div>
        </div>
    </div>
    <!-- 以上页面内容 开发时删除 -->

    <!--[if (gte IE 9)|!(IE)]><!-->
    <script src="assets/js/jquery.min.js"></script>
    <!--<![endif]-->
    <script src="assets/js/amazeui.min.js"></script>
    <script src="js/loading.js"></script>
    <script src="js/jquery.page.js"></script>
    <script>
        var token1 = sessionStorage['token'];
        var method1 = "get_allincome";
        var type1 = 2;
        //        第几页
        var p1 = 1;
        //        每页几条数据
        var pagesize1 = 5;
        $.ajax({
            type: 'POST',
            url: "http://www.rice.com/app/api/h5_access",
            contentType: "application/x-www-form-urlencoded; charset=utf-8",
            datatype: "JSON",
            data: {
                method: method1,
                token: token1,
                type: type1,
                p: p1,
                pagesize: pagesize1
            },
            success: function (data) {
                var data1 = JSON.parse(data);
                if (data1.status === 1) {
                    var html = "";
                    for (var i in data1.data.res) {
                        var hh = data1.data.res[i].add_time;
                        var date = new Date(hh * 1000);
                        var Y = date.getFullYear() + '-';
                        var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() +
                            1) + '-';
                        var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' ';
                        var h = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()) + ':';
                        var m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes()) +
                            ':';
                        var s = date.getSeconds();
                        html +=
                            `<div class="am-u-sm-12 bg-white" style="font-size:14px;margin-bottom:5px;">`;
                        html += `<div class="am-u-sm-7">` + data1.data.res[i].type + `</div>`;
                        html += `<div class="am-u-sm-5" style="text-align: right;">` + data1.data.res[i].money +
                            `</div>`;
                        html += `<div class="am-u-sm-12" style="padding:0 1rem;">` + Y + M + D + h + m + s +
                            `</div>`;
                        html += `<div class="am-u-sm-12" style="padding:0 1rem;">备注：` + data1.data.res[i].note +
                            `</div>`;
                        html += `</div>`;
                    }
                    if (html == "") {
                        $("#lr_list").html(
                            "<div style='width:60%;margin:20px 20%;clear:both;'><img src='img/roun.png' style='width:100%;'></div>"
                        );
                        $(".tcdPageCode").css("display", "none");
                    } else {
                        $("#lr_list").html(html);
                    }
                    $("#todaymoney").html(data1.data.todaymoney);
                    $("#cash").html(data1.data.cash);
                    $("#total").html("￥" + data1.data.total);
                    var r = data1.data.count;
                    r = Math.ceil(r / pagesize1);
                    $(".tcdPageCode").createPage({
                        pageCount: r,
                        current: 1,
                        backFn: function (pagesize1) {}
                    });
                } else if (Number(data1.status) == 2) {
                    alert(data1.message);
                    window.location.href = "login.html";
                } else {
                    alert(data1.message);
                }
            }
        });
        $(".tcdPageCode").on("click", 'a', function () {
            var h = $(this).html();
            if (h == "下一页") {
                var t = $('.tcdPageCode  span.current').html();
                t = parseInt(t);
                p1 = t + 1;
            } else if (h == "上一页") {
                var t = $('.tcdPageCode  span.current').html();
                t = parseInt(t);
                p1 = t - 1;
            } else {
                h = parseInt(h);
                p1 = h;
            }
            $.ajax({
                type: 'POST',
                url: "http://www.rice.com/app/api/h5_access",
                contentType: "application/x-www-form-urlencoded; charset=utf-8",
                datatype: "JSON",
                data: {
                    method: method1,
                    token: token1,
                    type: type1,
                    p: p1,
                    pagesize: pagesize1
                },
                success: function (data) {
                    var data1 = JSON.parse(data);
                    if (data1.status === 1) {
                        var html = "";
                        for (var i in data1.data.res) {
                            var hh = data1.data.res[i].add_time;
                            var date = new Date(hh * 1000);
                            var Y = date.getFullYear() + '-';
                            var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() +
                                1) + '-';
                            var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) +
                                ' ';
                            var h = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()) +
                                ':';
                            var m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes()) +
                                ':';
                            var s = date.getSeconds();
                            html +=
                                `<div class="am-u-sm-12 bg-white" style="font-size:14px;margin-bottom:5px;">`;
                            html += `<div class="am-u-sm-7">` + data1.data.res[i].type + `</div>`;
                            html += `<div class="am-u-sm-5" style="text-align: right;">` + data1.data
                                .res[i].money + `</div>`;
                            html += `<div class="am-u-sm-12" style="padding:0 1rem;">` + Y + M + D +
                                h + m + s + `</div>`;
                            html += `</div>`;
                        }
                        $("#lr_list").html(html);
                        var r = data1.data.count;
                        r = Math.ceil(r / pagesize1);
                        $(".tcdPageCode").createPage({
                            pageCount: r,
                            current: p1,
                            backFn: function (pagesize1) {}
                        });
                    } else if (Number(data1.status) == 2) {
                        alert(data1.message);
                        window.location.href = "login.html";
                    } else {
                        alert(data1.message);
                    }
                }
            });
        })
    </script>
</body>

</html>